package com.yoku.view;

import com.google.common.eventbus.AsyncEventBus;
import com.google.common.eventbus.EventBus;
import org.springframework.amqp.core.Queue;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.Executors;

/**
 * Desc:
 * Date: 2016/12/13
 */

@Configuration
@EnableAutoConfiguration
public class ViewAutoConfiguration {

    @Bean(name = "myQueue")
    public Queue myQueue() {
        return new Queue("my-queue");
    }

    @Bean
    public EventBus eventBus(){
        return new AsyncEventBus(Executors.newFixedThreadPool(5));
    }
}
